/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.customer.facade.order.check;

import cn.hutool.core.lang.Assert;
import info.peigen.hotpot.business.customer.facade.enums.CustomerField;
import info.peigen.hotpot.business.customer.facade.order.base.CustomerServiceOrderBase;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

/**
 * <b>(CustomerDuplicateCheckOrder)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/10/14
 */
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class CustomerDuplicateCheckOrder extends CustomerServiceOrderBase {
    String        customerId;
    /** 字段 */
    CustomerField customerField;
    /** 字段值 */
    String        value;

    @Override
    public void check() {
        Assert.isTrue(customerField.isInList(CustomerField.enterpriseName, CustomerField.uniformSocialCreditCode), "不支持的校验字段");
        super.check();
    }
}
